<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<!--view层-->
<div id="app">
  <h1>数组绑定语法学习,不常用</h1>
  <h1 class="title" :class="['active','line']">{{message}}</h1>
  <h1 class="title active line">{{message}}</h1>
  <h1>有一个特殊情况,就是可以动态修改class的时候使用</h1>
  <h1 :class="['active','line']">{{message}}</h1>
  <h1 :class="[active,line]">{{message}}</h1>
  <h1 :class="getclass()">{{message}}</h1>


</div>
<!--viewModel层-->
<script src="../../js/vue.js"></script>
<!--model层-->
<script>
  const app = new Vue({
    el: '#app',
    data: {
      message: '数组绑定',
      active: 'isactive',
      line: 'isline'
    }, methods: {
      getclass: function () {
        //声明方法
        return [this.active, this.line]
      }
    }, created: function () {
      //生命周期
    }, mounted: function () {
      //生命周期
    }
  })
</script>
</body>
</html>